import os
def file_size(file1):
    f1=open(file1,'rb')
    content=f1.readline()
    while len(content)>0:
        size=len(content)
    return(size)
    f1.close()

def dir_size(dir1):
    dlist=os.listdir(dir1)
    for f in dlist:
        file1=os.path.join(dir1,f)
        if os.path.isfile(file1):
            file_size(file1)
        if os.path.isdir(file1):
            dir_size(file1)
